import Vue from "vue";
import VueRouter from "vue-router";
import HomeView from "../views/HomeView.vue";
import Login from "@/components/Login.vue";
import OrderManager from "@/components/order/OrderManager.vue";
import MonitorIndex from "@/components/monitor/MonitorIndex.vue";
import AfterSalesIndex from "@/components/aftersales/AfterSalesIndex.vue";
import OrderDetail from "@/components/order/OrderDetail.vue";
import ServiceManager from "@/components/service/ServiceManager.vue";
import OrderPay from "@/components/order/OrderPay.vue";
import InterfaceManger from "@/components/interface/InterfaceManager.vue";
import Call from "@/components/call/Call.vue";
import AfterSaleInfo from "@/components/service/AfterSaleInfo.vue";
import OrderChild from "@/components/order/OrderChild.vue";

Vue.use(VueRouter);

const routes = [
  { component: Login, path: "/" },

  {
    path: "/home",
    component: HomeView,
    children: [
      { path: "/OrderManager", component: OrderManager },
      { path: "/OrderDetail", component: OrderDetail},
      { path: "/OrderChild", component: OrderChild },
      { path: "/MonitorIndex", component: MonitorIndex },
      { path: "/ServiceManager", component: ServiceManager },
      { path: "/InterfaceManger", component: InterfaceManger },
      { path: "/AfterSaleInfo", component: AfterSaleInfo },
    ],
  },
  { path: "/Call", component: Call },
  { path: "/OrderPay", component: OrderPay },
];

const router = new VueRouter({
  routes,
});

export default router;
